package com.luom.fsp.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.luom.fsp.model.dto.carousel.CarouselQueryRequest;
import com.luom.fsp.model.entity.Carousel;
import com.luom.fsp.model.vo.CarouselVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 优惠券表服务
 *
*/
public interface CarouselService extends IService<Carousel> {

    /**
     * 校验数据
     *
     * @param carousel
     * @param add 对创建的数据进行校验
     */
    void validCarousel(Carousel carousel, boolean add);

    /**
     * 获取查询条件
     *
     * @param carouselQueryRequest
     * @return
     */
    QueryWrapper<Carousel> getQueryWrapper(CarouselQueryRequest carouselQueryRequest);
    
    /**
     * 获取优惠券表封装
     *
     * @param carousel
     * @param request
     * @return
     */
    CarouselVO getCarouselVO(Carousel carousel, HttpServletRequest request);

    /**
     * 分页获取优惠券表封装
     *
     * @param carouselPage
     * @param request
     * @return
     */
    Page<CarouselVO> getCarouselVOPage(Page<Carousel> carouselPage, HttpServletRequest request);
}
